/*
 * DateHelper.java
 *
 * Created on April 8, 2007, 4:16 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package helpers;

import java.text.Format;
import java.text.SimpleDateFormat;

/**
 *
 * @author Alirio
 */
public class DateHelper {
  
  public static String formatDateAs400(java.util.Date date) {
    Format formatter  = new SimpleDateFormat("yyyyMMdd");
    return formatter.format(date);
  }
  
  public static String formatHhMmSsAmPmTime(java.util.Date time) {
    Format formatter = new SimpleDateFormat("hh:mm:ss a");
    return formatter.format(time);
  }
  
  public static String formatHhMmSsTime(java.util.Date time) {
    Format formatter = new SimpleDateFormat("hh:mm:ss");
    return formatter.format(time);
  }
  
  public static String formatStringDate(String dateYyyyMmDd) {
    return (dateYyyyMmDd.substring(6,8) + "/" + dateYyyyMmDd.substring(4, 6) + dateYyyyMmDd.substring(0, 4));
  }
  
   public static String formatStringDateAs400(String dateddMMyyyy) {
       
    return (dateddMMyyyy.substring(6,10)  + dateddMMyyyy.substring(3, 5) + dateddMMyyyy.substring(0, 2));
  }
  
  
  
}